/**
 * for login page 
 */
$(function(){
	$("#login_btn").click(function(){
		login();
	});
})

function login(){
	var userName = $.trim($("#userName").val());
	var password = $.trim($("#password").val());
	if(userName == ""){
		$(".login li:first span").html("用户名不能为空...");
	} else if(password == ""){
		$(".login li:first span").html("密码不能为空...");
	} else {
		$(".login li:first span").html("<img src='login/images/login/loading.gif'/>  正在登录...");
		location.href = "pages/index.jsp";
	}
}

function clearLoading(){
	$(".login input").focus(function(){
		if($.trim($("#userName").val()) == "" || $.trim($("#password").val()) == ""){
			$(".login li:first span").html("");
		}
	});
}